home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unixlib.lha / unix / test / popen_r_test.c < prev    next >
C/C++ Source or Header  |  1995-09-06  |  276b  |  20 lines

  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int c;
  6.     int first = 1;
  7.     FILE *fp = popen("io_test", "r");
  8.  
  9.     printf("This is the child output:");
  10.     while ((c = getc(fp)) != EOF) {
  11.         if (first) {
  12.             printf("\n");
  13.             first = 0;
  14.         }
  15.         printf("%4d %c\n", c, c);
  16.     }
  17.     pclose(fp);
  18.     return(0);
  19. }
  20.